home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-11 | 9.2 KB | 490 lines | [TEXT/MPS ] |
- ;
- ; File: CMApplication.a
- ;
- ; Copyright: © 1984-1994 by Apple Computer, Inc.
- ; All rights reserved.
- ;
- ; Version: Universal Interfaces 2.0a3 ETO #16, MPW prerelease. Friday, November 11, 1994.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
-
- IF &TYPE('__CMAPPLICATION__') = 'UNDEFINED' THEN
- __CMAPPLICATION__ SET 1
-
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- ; include 'ConditionalMacros.a' ;
-
- IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
- include 'Quickdraw.a'
- ENDIF
- ; include 'MixedMode.a' ;
- ; include 'QuickdrawText.a' ;
-
- IF &TYPE('__WINDOWS__') = 'UNDEFINED' THEN
- include 'Windows.a'
- ENDIF
- ; include 'Memory.a' ;
- ; include 'Events.a' ;
- ; include 'OSUtils.a' ;
- ; include 'Controls.a' ;
- ; include 'Menus.a' ;
-
- IF &TYPE('__PRINTING__') = 'UNDEFINED' THEN
- include 'Printing.a'
- ENDIF
- ; include 'Errors.a' ;
- ; include 'Dialogs.a' ;
- ; include 'TextEdit.a' ;
-
- CMTrap EQU $ABEE
-
- ; PicComments
- CMBeginProfile EQU 220
- CMEndProfile EQU 221
- CMEnableMatching EQU 222
- CMDisableMatching EQU 223
-
- ; Defines for fieldMask in profile search record
- kMatchCMMType EQU $00000001
- kMatchApplProfileVersion EQU $00000002
- kMatchDataType EQU $00000004
- kMatchDeviceType EQU $00000008
- kMatchDeviceManufacturer EQU $00000010
- kMatchDeviceModel EQU $00000020
- kMatchDeviceAttributes EQU $00000040
- kMatchFlags EQU $00000080
- kMatchOptions EQU $00000100
- kMatchWhite EQU $00000200
- kMatchBlack EQU $00000400
-
- ; Profile Header version
- kCMApplProfileVersion EQU $0100
-
- ; Data types
- rgbData EQU 'RGB '
- cmykData EQU 'CMYK'
- grayData EQU 'GRAY'
- xyzData EQU 'XYZ '
-
- ; Device types
- monitorDevice EQU 'mntr'
- scannerDevice EQU 'scnr'
- printerDevice EQU 'prtr'
- qdSystemDevice EQU 'sys '
- qdGDevice EQU 'gdev'
-
- ; Profile flags
- CMNativeMatchingPreferred EQU $00000001 ; Default to native not preferred
- CMTurnOffCache EQU $00000002 ; Default to turn on CMM cache
-
- ; Profile options
- CMPerceptualMatch EQU $0000 ; Default. For photographic images
- CMColorimetricMatch EQU $0001 ; Exact matching when possible
- CMSaturationMatch EQU $0002 ; For solid colors
-
- ; ColorSync result codes
- CMNoError EQU 0
- CMProfileError EQU -170
- CMMethodError EQU -171
- CMMemFullError EQU -172
- CMUnimplementedError EQU -173
- CMParamError EQU -174
- CMMethodNotFound EQU -175 ; CMM not present
- CMProfileNotFound EQU -176 ; Responder error
- CMProfilesIdentical EQU -177 ; Profiles the same
- CMCantConcatenateError EQU -178 ; Profile can't be concatenated
- CMCantXYZ EQU -179 ; CMM cant handle XYZ space
- CMCantDeleteProfile EQU -180 ; Responder error
- CMUnsupportedDataType EQU -181 ; Responder error
- CMNoCurrentProfile EQU -182 ; Responder error
-
- ;
- ;** Types
- ;
- XYZColor RECORD 0
- X ds.w 1 ; 1.15 bit unsigned fixed numbers
- Y ds.w 1
- Z ds.w 1
- sizeof EQU 6
- ENDR
-
- CMYKColor RECORD 0
- cyan ds.w 1
- magenta ds.w 1
- yellow ds.w 1
- black ds.w 1
- sizeof EQU 8
- ENDR
-
- CMColor RECORD 0
- VariantLevel0Begin EQU *
- rgb ds RGBColor
- ORG VariantLevel0Begin
- xyz ds XYZColor
- ORG VariantLevel0Begin
- cmyk ds CMYKColor
- sizeof EQU 8
- ENDR
-
- CMHeader RECORD 0
- size ds.l 1 ; This is the total size of the Profile including custom data
- CMMType ds.l 1 ; Corresponding CMM
- applProfileVersion ds.l 1 ; Version of CMProfile format
- dataType ds.l 1 ; rgbData, etc.
- deviceType ds.l 1 ; monitorDevice, etc.
- deviceManufacturer ds.l 1 ; Registered with DTS
- deviceModel ds.l 1 ; Specific to Manufacturer
- deviceAttributes ds.l 2 ; Attributes like paper, ink, etc.
- profileNameOffset ds.l 1 ; Offset to profile name from top of data
- customDataOffset ds.l 1 ; Offset to custom data from top of data
- flags ds.l 1
- options ds.l 1
- white ds XYZColor
- black ds XYZColor
- sizeof EQU 64
- ENDR
-
- CMProfileSearchRecord RECORD 0
- header ds CMHeader
- fieldMask ds.l 1
- reserved ds.l 2
- sizeof EQU 76
- ENDR
-
- CMProfileChromaticities RECORD 0
- red ds XYZColor
- green ds XYZColor
- blue ds XYZColor
- cyan ds XYZColor
- magenta ds XYZColor
- yellow ds XYZColor
- sizeof EQU 36
- ENDR
-
- IString RECORD 0
- theScript ds.w 1
- theString ds.l 16
- sizeof EQU 66
- ENDR
-
-
- grayResponse EQU 0
- redResponse EQU 1
- greenResponse EQU 2
- blueResponse EQU 3
- cyanResponse EQU 4
- magentaResponse EQU 5
- yellowResponse EQU 6
- ucrResponse EQU 7
- bgResponse EQU 8
- onePlusLastResponse EQU 9
-
- CMProfileResponse RECORD 0
- counts ds.w 1
- data ds.w 1 ; Variable size
- sizeof EQU 4
- ENDR
-
- CMProfile RECORD 0
- header ds CMHeader
- profile ds CMProfileChromaticities
- response ds CMProfileResponse ; Variable size
- profileName ds IString ; Variable size
- customData ds.b 1 ; Optional variable length custom CMM data
- sizeof EQU 172
- ENDR
-
- ;
- ;** Printing Stuff that will be moved later
- ;
-
- enableColorMatchingOp EQU 12
- registerProfileOp EQU 13
-
- ; PrGeneral parameter blocks
- TEnableColorMatchingBlk RECORD 0
- iOpCode ds.w 1
- iError ds.w 1
- lReserved ds.l 1
- hPrint ds.l 1
- fEnableIt ds.b 1
- filler ds.b 1
- sizeof EQU 14
- ENDR
-
- TRegisterProfileBlk RECORD 0
- iOpCode ds.w 1
- iError ds.w 1
- lReserved ds.l 1
- hPrint ds.l 1
- fRegisterIt ds.b 1
- filler ds.b 1
- sizeof EQU 14
- ENDR
-
- ;
- ;** High Level Calls
- ;
- IF GENERATING68K THEN
- Macro
- _BeginMatching
- dc.w $203C
- dc.w $000C
- dc.w $0000
- dc.w $ABEE
- EndM
- ELSE
- IMPORT BeginMatching
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _EndMatching
- dc.w $203C
- dc.w $0004
- dc.w $0001
- dc.w $ABEE
- EndM
- ELSE
- IMPORT EndMatching
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _GetProfile
- dc.w $203C
- dc.w $0010
- dc.w $0000
- dc.w $ABEE
- EndM
- ELSE
- IMPORT GetProfile
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SetProfile
- dc.w $203C
- dc.w $000C
- dc.w $0000
- dc.w $ABEE
- EndM
- ELSE
- IMPORT SetProfile
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SetProfileDescription
- dc.w $203C
- dc.w $0010
- dc.w $0006
- dc.w $ABEE
- EndM
- ELSE
- IMPORT SetProfileDescription
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _GetColorSyncFolderSpec
- dc.w $203C
- dc.w $000C
- dc.w $0007
- dc.w $ABEE
- EndM
- ELSE
- IMPORT GetColorSyncFolderSpec
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _GetIndexedProfile
- dc.w $203C
- dc.w $0014
- dc.w $0008
- dc.w $ABEE
- EndM
- ELSE
- IMPORT GetIndexedProfile
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _DeleteDeviceProfile
- dc.w $203C
- dc.w $000C
- dc.w $0009
- dc.w $ABEE
- EndM
- ELSE
- IMPORT DeleteDeviceProfile
- ENDIF
-
- ;
- ;** Data interchange routines
- ;
- IF GENERATING68K THEN
- Macro
- _UseProfile
- dc.w $203C
- dc.w $0004
- dc.w $0000
- dc.w $ABEE
- EndM
- ELSE
- IMPORT UseProfile
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _DrawMatchedPicture
- dc.w $203C
- dc.w $000C
- dc.w $0000
- dc.w $ABEE
- EndM
- ELSE
- IMPORT DrawMatchedPicture
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _EnableMatching
- dc.w $203C
- dc.w $0002
- dc.w $0003
- dc.w $ABEE
- EndM
- ELSE
- IMPORT EnableMatching
- ENDIF
-
- ;
- ;** Profile concatenation
- ;
- IF GENERATING68K THEN
- Macro
- _ConcatenateProfiles
- dc.w $203C
- dc.w $000C
- dc.w $0002
- dc.w $ABEE
- EndM
- ELSE
- IMPORT ConcatenateProfiles
- ENDIF
-
- ;
- ;** Profile manipulation routines
- ;
- IF GENERATING68K THEN
- Macro
- _GetProfileName
- dc.w $203C
- dc.w $0008
- dc.w $0004
- dc.w $ABEE
- EndM
- ELSE
- IMPORT GetProfileName
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _GetProfileAdditionalDataOffset
- dc.w $203C
- dc.w $0004
- dc.w $0005
- dc.w $ABEE
- EndM
- ELSE
- IMPORT GetProfileAdditionalDataOffset
- ENDIF
-
- ;
- ;** Low level color calculation routines
- ;
- IF GENERATING68K THEN
- Macro
- _CWNewColorWorld
- dc.w $203C
- dc.w $000C
- dc.w $0000
- dc.w $ABEE
- EndM
- ELSE
- IMPORT CWNewColorWorld
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CWDisposeColorWorld
- dc.w $203C
- dc.w $0004
- dc.w $0000
- dc.w $ABEE
- EndM
- ELSE
- IMPORT CWDisposeColorWorld
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CWMatchColors
- dc.w $203C
- dc.w $000C
- dc.w $0000
- dc.w $ABEE
- EndM
- ELSE
- IMPORT CWMatchColors
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CWCheckColors
- dc.w $203C
- dc.w $0010
- dc.w $0000
- dc.w $ABEE
- EndM
- ELSE
- IMPORT CWCheckColors
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CWMatchPixMap
- dc.w $203C
- dc.w $0010
- dc.w $0000
- dc.w $ABEE
- EndM
- ELSE
- IMPORT CWMatchPixMap
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CWCheckPixMap
- dc.w $203C
- dc.w $0014
- dc.w $0000
- dc.w $ABEE
- EndM
- ELSE
- IMPORT CWCheckPixMap
- ENDIF
-
- ENDIF ; __CMAPPLICATION__
-